package string;

public class SubStringDemo {
    public static void main(String[] args) {
        String str="java学习电脑,笔记本intel";
        System.out.println(str.substring(2,7));
        str=(String)(str.subSequence(2,7));
        System.out.println(str);
        String str2="www.baidu.com";
        int start=str2.indexOf(".")+1;
        int end=str2.lastIndexOf(".");
        str2=str2.substring(start,end);
        System.out.println(str2);
    }
}
